home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
util
/
cli
/
gengui21.lha
/
Gengui2.1
/
Examples
/
backfillhook.h
next >
Wrap
C/C++ Source or Header
|
1995-06-18
|
1KB
|
45 lines
#ifndef BACKFILLHOOK
#define BACKFILLHOOK
#include <graphics/gfxmacros.h>
struct LMsg {
struct Layer *Layer;
WORD MinX,MinY; /* Coordinates in the screen */
WORD MaxX,MaxY;
LONG OffsetX,OffsetY; /* Coordinates in the window */
};
ULONG __interrupt __saveds __asm HookFunc(register __a0 struct Hook *hook,
register __a2 struct RastPort *rastport,
register __a1 struct LMsg *msg)
{
struct RastPort rp=*rastport;
ULONG color;
static __chip USHORT bitmap[]={0xaaaa,0x5555,0xaaaa};
rp.Layer=NULL;
color=(ULONG)hook->h_Data;
SetAPen(&rp,color>>16);
SetBPen(&rp,color&0xffff);
SetDrMd(&rp,JAM2);
/* Adjust the pattern to the window position */
if((msg->MinX ^ msg->MinY ^ msg->OffsetX ^ msg->OffsetY) & 1)
{SetAfPt(&rp,(bitmap+1),1);} else
{SetAfPt(&rp,bitmap,1);}
RectFill(&rp,msg->MinX,msg->MinY,msg->MaxX,msg->MaxY);
return(0);
}
#define COLOR(a,b) (void *)(((a)<<16)|b)
#endif